<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	
	

<h:head>
	<link rel="stylesheet" href="../public/css/style.css" type="text/css" />
	<link rel="stylesheet" href="../public/css/social-icons.css" type="text/css"  />
</h:head>

<ui:composition template="/public/template.xhtml">
	<ui:define name="conteudo">
		<h:form>
			<p:growl id="messages" showDetail="true" autoUpdate="true"
				closable="true" />
			
			
			<h:outputText value="Titulo: " />
			<p:inputText value="#{palestranteMB.trabalho.titulo}" required="true" maxlength="80" size="100" />
			<br/><br/>
			<h:outputText value="Descrição: " />
			<p:editor id="editor" value="#{palestranteMB.trabalho.descricao}"
				width="600" required="true" />
			
			<br/>
			<h:outputText value="Tipo Trabalho: " />
			<p:selectOneMenu value="#{palestranteMB.tipoT.id}">
				<f:selectItem itemValue="" itemLabel="Selecione..." />
				<f:selectItems value="#{palestranteMB.tipoTrabalho}" />
			</p:selectOneMenu>
			<br/><br/>
			<h:outputText value="Quantidade de Participantes: "/>
			<h:inputText value="#{palestranteMB.trabalho.qtdParticipantes}"/>
			<br/><br/>
			<h:outputText value="Nome" />
			<h:inputText value="#{palestranteMB.usuario.nome}" />
			<h:outputText value="CPF" />
			<p:inputMask mask="999.999.999-99"
				value="#{palestranteMB.usuario.cpf}" />
			<h:outputText value="Email" />
			<h:inputText value="#{palestranteMB.usuario.email}" />

			<h:commandButton action="#{palestranteMB.adicionarPalestrante}"
				value="Adicionar"  icon="ui-icon-plus" />
			<br/><br/>
			<h:dataTable value="#{palestranteMB.listarPalestrantes}" var="p">

				<h:column>
					
					<h:outputText value="#{p.usuario.nome}" />
				</h:column>
				<h:column>
					
					<h:outputText value="#{p.usuario.cpf}" />
				</h:column>
				<h:column>
					
					<h:outputText value="#{p.usuario.email}" />
				</h:column>
				<h:column>
					
					<h:commandButton id="delete" action="#{palestranteMB.remover(p)}"
						 value="Deletar" />
				</h:column>
			</h:dataTable>
			<br/>
			<p align="right">
			<p:commandButton action="#{palestranteMB.submeterTrabalho}"
				value="Salvar"  icon="ui-icon-disk"/>
			</p>
		</h:form>
		
	</ui:define>
</ui:composition>


</html>